<?php
namespace app;

ini_set('display_errors', 'on');

if(strpos(strtolower(PHP_OS), 'win') === 0)
{
    exit("start.php not support windows, please use start_for_win.bat\n");
}
// 检查扩展
if(!extension_loaded('pcntl'))
{
    exit("Please install pcntl extension. See http://doc3.workerman.net/appendices/install-extension.html\n");
}
if(!extension_loaded('posix'))
{
    exit("Please install posix extension. See http://doc3.workerman.net/appendices/install-extension.html\n");
}

$cli = preg_match("/cli/i", php_sapi_name()) ? true : false ;
if ( $cli==false ) {
    print_r(['no cli']);exit();
}else{
    @list($__this,$action,$type)=$argv;
}

// 标记是全局启动
define('GLOBAL_START', 1);

require_once __DIR__ . '/vendor/autoload.php';

require_once __DIR__ . '/workerGateway.php';
new workerGateway($action,$type);